﻿using Arch.EntityFrameworkCore.UnitOfWork;
using Arch.EntityFrameworkCore.UnitOfWork.Collections;
using MyTodo.Shared.Parameters;
using MyTodo.Shared.Services;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MyTodo.Services.Interfaces;

public interface IServiceBase<TEntity> where TEntity : class
{
    Task<ApiResponse<TEntity>> AddAsync(TEntity entity);
    Task<ApiResponse<TEntity>> UpdateAsync(TEntity entity);
    Task<ApiResponse> DeleteAsync(int id);
    Task<ApiResponse<TEntity>> GetFirstOfDefaultAsync(int id);
    Task<ApiResponse<PagedList<TEntity>>> GetAllAsync(QueryParameter parameter);
}
